package com.nuit.cxl.aop.bilibili.aop;


import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class Myadvice {

    @Pointcut("execution(void com..update(..))")
    public void pointCut(){}

//    @After("pointCut()")
    public void showTime(){
        System.out.println("当前时间：" + System.currentTimeMillis());
    }

    @Around("pointCut()")
    public Object showTime(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("前当前时间：" + System.currentTimeMillis());
        Object ret = joinPoint.proceed();
        System.out.println("后当前时间：" + System.currentTimeMillis());
        return ret;
    }

}
